package com.service.device;

import com.dao.secondary.device.DevicePcbWorkDailyRecordInfoMapper;
import com.dao.secondary.device.DevicePmdWorkDailyRecordInfoMapper;
import com.github.pagehelper.PageHelper;
import com.model.domain.device.GetDevicePcbWorkDailyRecordInfoDO;
import com.model.domain.device.GetDevicePmdWorkDailyRecordInfoDO;
import com.model.pojo.device.DevicePcbWorkDailyRecordInfo;
import com.model.pojo.device.DevicePmdWorkDailyRecordInfo;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;


/**
 * @Author: zql
 * @Description: obd作业日报统计信息服务
 * @Data: 2023-07-06
 */
@Slf4j
@Service
@RequiredArgsConstructor
public class DevicePmdWorkDailyRecordInfoService {
    private final DevicePmdWorkDailyRecordInfoMapper devicePmdWorkDailyRecordInfoMapper;

    public List<DevicePmdWorkDailyRecordInfo> getPageList(GetDevicePmdWorkDailyRecordInfoDO getDevicePmdWorkDailyRecordInfoDO){
        PageHelper.clearPage();
        PageHelper.startPage(getDevicePmdWorkDailyRecordInfoDO.getPage(),getDevicePmdWorkDailyRecordInfoDO.getPageSize(),getDevicePmdWorkDailyRecordInfoDO.getSortRow()+getDevicePmdWorkDailyRecordInfoDO.getSortOrder());
        return devicePmdWorkDailyRecordInfoMapper.selectList(getDevicePmdWorkDailyRecordInfoDO);
    }
    public void saveList(List<DevicePmdWorkDailyRecordInfo> list){
        devicePmdWorkDailyRecordInfoMapper.insertListSelective(list);
    }
    public int save(DevicePmdWorkDailyRecordInfo info){
        info.setCreatedTime(new Date());
        return devicePmdWorkDailyRecordInfoMapper.insertSelective(info);
    }
}
